class Dog(object):
    def __init__(self,name,age):
        self.name = name
        self.age = age

    def __str__(self):
        return f'{self.name},{self.age}'

    def __repr__(self):
        return f'{self.name}'

list1 = [Dog('小黄',3),Dog('小白',4),Dog('小花',6)]
print(list1)